package org.bspv.pharma.manager;

import org.bspv.pharma.model.User;
import org.springframework.security.core.userdetails.UsernameNotFoundException;

/**
 * 
 * @author guillaume
 * 
 */
public interface UserManager extends Manager<User, Long> {

	/**
	 * Retrieves a user by userId. An exception is thrown if user not found
	 * 
	 * @param userId
	 *            the identifier for the user
	 * @return User
	 */
	User getUser(String userId);

	/**
	 * Finds a user by their username.
	 * 
	 * @param username
	 *            the user's username used to login
	 * @return User a populated user object
	 * @throws org.springframework.security.userdetails.UsernameNotFoundException
	 *             exception thrown when user not found
	 */
	User getUserByUsername(String username) throws UsernameNotFoundException;

}
